#version 320 es
precision mediump float;
in vec2 u_v;
out vec4 color;
uniform sampler2D tex0;
float kernel1[9];
vec2 offsets[9];
const float offset = 1.0f / 300.0f;
void init(void)
{
    kernel1[0] = -1.0f;
    kernel1[1] = -1.0f;
    kernel1[2] = -1.0f;
    kernel1[3] = -1.0f;
    kernel1[4] = 9.0f;
    kernel1[5] = -1.0f;
    kernel1[6] = -1.0f;
    kernel1[7] = -1.0f;
    kernel1[8] = -1.0f;
    offsets[0] = vec2(-offset, offset);
    offsets[1] = vec2(0.0f, offset);
    offsets[2] = vec2(offset, offset);
    offsets[3] = vec2(-offset, 0.0f);
    offsets[4] = vec2(0.0f, 0.0f);
    offsets[5] = vec2(offset, 0.0f);
    offsets[6] = vec2(-offset, -offset);
    offsets[7] = vec2(0.0f, -offset);
    offsets[8] = vec2(-offset, -offset);
}
void main(void) {
    if(true)
    {
        init();
    }
    //基于kerne的后视镜处理
    for(int i = 0;i < 9;i++)
    {
        color += texture(tex0, u_v + offsets[i]) * kernel1[i];
    }
}
